//
//  ZXBaseNavigationViewController.m
//  MortgageBang
//
//  Created by apple on 16/6/23.
//  Copyright © 2016年 lzy. All rights reserved.
//

#import "ZXBaseNavigationViewController.h"

@interface ZXBaseNavigationViewController ()<UIGestureRecognizerDelegate>

@end

@implementation ZXBaseNavigationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 控制导航控制器开启侧滑效果，防止重写左侧按钮后侧滑效果失效
    self.interactivePopGestureRecognizer.delegate = self;
}
- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer
{
    NSLog(@"class== %@",[gestureRecognizer.view.inputViewController class]);
    if (self.childViewControllers.count == 1)
    {
        return NO;
    }
    return YES;
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)pushViewController:(ZXBaseViewController *)viewController animated:(BOOL)animated
{
    if (self.viewControllers.count > 0) { // 如果现在push的不是栈底控制器(最先push进来的那个控制器)
        viewController.hidesBottomBarWhenPushed = YES;//!
    }else{
        viewController.hidesBottomBarWhenPushed = NO;
    }
    
    [super pushViewController:viewController animated:animated];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
